﻿// <copyright file="IPlugIn.cs" company="Pelican Design &amp; Development">
//      Copyright (c) Pelican Design &amp; Development. All Rights Reserved.
// </copyright>
// <author id="5c2316d3-622a-4a8d-816d-5054a48f415f">Arseni Mourzenko</author>

namespace PelicanDD.Samples.CacheInSandbox
{
    /// <summary>
    /// Represents a plug-in intended to run in partial trust context.
    /// </summary>
    public interface IPlugIn
    {
        /// <summary>
        /// Gets or sets the cache.
        /// </summary>
        ICacheWrapper Cache { get; set; }

        /// <summary>
        /// Gets the name of the plug-in.
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Creates a file containing sample text, or fails if there are no enough permissions.
        /// </summary>
        /// <param name="fileName">The full path to the file to write.</param>
        void WriteSampleFile(string fileName);

        /// <summary>
        /// Stores a value into cache, then loads the same value from cache and returns it.
        /// </summary>
        /// <param name="value">The value to store in cache.</param>
        /// <returns>The value from cache.</returns>
        string UseCache(string value);
    }
}
